import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { AssemblyDrawingViewService } from '@core/services/assemblyDrawing/assemblyDrawing.view.service';


@Component({
  templateUrl: './cad-model-info.component.html',
  selector: 'cad-model-info',
  styleUrls: ['./cad-model-info.component.scss'],
})
export class CadModelInfoComponent implements OnInit, OnDestroy {

  private subscription: Subscription;
  data: any = {};

  constructor(
    private assemblyDrawingViewService: AssemblyDrawingViewService,
  ) {

  }

  ngOnInit(): void {
    this.subscription = this.assemblyDrawingViewService.modelInfoChange$.subscribe((data) => {
      this.data = data;
    });
  }

  ngOnDestroy(): void {
    this.subscription.unsubscribe();
  }
}
